package com.zhang.service;

import com.myspring.anno.MyComponent;
import com.myspring.aware.BeanNameAware;
import com.myspring.aware.DisposableBean;
import com.myspring.aware.InitializingBean;


@MyComponent
public class Aware implements BeanNameAware, InitializingBean, DisposableBean {

    String beanName;


    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    public void test() {
        System.out.println("测试BeanNameAware:==="+beanName);
    }

    @Override
    public void afterPropertiesSet() {

    }

    @Override
    public void destroy() throws Exception {
        System.out.println("即将销毁bean:===" + beanName);
    }
}
